﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AuthorityUserAdd.aspx.cs" Inherits="_2010web.Manage.webinfo.AuthorityUserAdd" %>

<%@ Import Namespace="OF.Utility" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
        <!-- #include file="~/html/file.aspx" -->
</head>
<body>
    <form id="form1" runat="server">
    <div class="wrap">
     <!-- #include file="~/html/top.aspx" -->
        <div class="das">
            <div class="contents">
              
                    <!-- #include file="~/html/menu.aspx" -->
                <div class="main ">
                    <div class="main_blc" style="_height: 1100px">
                        <div class="main_title">
                            <h3>
                                账户密码</h3>
                              <span class="more"><a href="Authorityuserlist.aspx">&lt;&lt; 返回用户列表</a></span> 
                        </div>
                      
                        <div class="das_form" id="das_form">
                       
                            <dl class="dl" style="display:none">
                                <dt class="dt">用户类型：</dt>
                                <dd class="dd">
                                    <asp:DropDownList runat="server" CssClass="inputtxt" ID="drpType">
                                </asp:DropDownList>
                                </dd>
                            </dl>
                            
                            <dl class="dl">
                                <dt class="dt">用户名：</dt>
                                <dd class="dd">
                                    <asp:TextBox CssClass="inputtxt w180" runat="server" MaxLength="16"
                                        ID="txtName" />
                                </dd>
                            </dl>
                               <dl class="dl">
                                <dt class="dt">联系电话：</dt>
                                <dd class="dd">
                                    <asp:TextBox CssClass="inputtxt w180" runat="server" MaxLength="16"
                                        ID="txtMobile" />
                                </dd>
                            </dl>
                              <dl class="dl">
                                <dt class="dt">登陆账号：</dt>
                                <dd class="dd">
                                    <asp:TextBox CssClass="inputtxt w180" runat="server" MaxLength="16"
                                        ID="txtEjLoginName" />
                                </dd>
                            </dl>
                            <dl  <%=strsytle %> class="dl">
                                <dt class="dt">原始密码：</dt>
                                <dd class="dd">
                                    <asp:TextBox CssClass="inputtxt w180"  runat="server" MaxLength="16"
                                        ID="txtOldPass" />
                                </dd>
                            </dl>
                            <dl class="dl">
                                <dt class="dt">密码：</dt>
                                <dd class="dd">
                                    <asp:TextBox CssClass="inputtxt w180" TextMode="Password" runat="server" MaxLength="16"
                                        ID="txtNewPass" />
                                </dd>
                            </dl>
                            <dl class="dl">
                                <dt class="dt">确认密码：</dt>
                                <dd class="dd">
                                    <asp:TextBox CssClass="inputtxt w180" TextMode="Password" runat="server" MaxLength="16"
                                        ID="txtNewPassToo" />
                                </dd>
                            </dl>
                            <dl class="dl">
                                <dt class="dt">角色：</dt>
                                <dd class="dd">
                                    <asp:DropDownList ID="RoleList"  runat="server"></asp:DropDownList>
                                </dd>
                            </dl>
                            <dl class="dl">
                                <dt class="dt"></dt>
                                <dd class="dd">
                                    <a class="submit" onclick="javascript:void(0);" href="#">
                                        <asp:Button ID="btnSave" Text="确定" runat="server" OnClientClick="return save();"
                                            OnClick="btnSave_Click" /></a>
                                </dd>
                            </dl>
                        </div>
                    </div>
                </div>
            </div>
            <sub class="tl"></sub><sub class="tr"></sub>
        </div>
        <sub class="tl"></sub>
    </div>
    <!-- #include file="~/html/foot.aspx" -->
     <script language="javascript">
         var DealerID = <%=DealerID%>;
         function save() {
             var $Password = "<%=txtOldPass.ClientID %>";
             var $txtNewPass = "<%=txtNewPass.ClientID %>";
             var $txtNewPassToo = "<%=txtNewPassToo.ClientID %>";
             var bool = true;
             _M.MsgNo('errorMsg_txtName');
             _M.MsgNo('errorMsg_txtEjLoginName');
             _M.MsgNo('errorMsg_' + $Password);
             _M.MsgNo('errorMsg_' + $txtNewPass);
             _M.MsgNo('errorMsg_' + $txtNewPassToo);

             if ($("#txtName").val() == "") {
                 $().AjaxManage.ErrorMessage("txtName", '用户名不允许为空！');
                 bool = false;
             }
             if ($("#txtEjLoginName").val() == "") {
                 $().AjaxManage.ErrorMessage("txtEjLoginName", '登陆账号不允许为空！');
                 bool = false;
             }
             if ($("#" + $txtNewPass).val() == "" && DealerID==-1) {
                 $().AjaxManage.ErrorMessage($txtNewPass, '密码不允许为空！');
                 bool = false;
             }
           

             if ($("#" + $txtNewPass).val() != $("#" + $txtNewPassToo).val()) {
               
                 $().AjaxManage.ErrorMessage($txtNewPassToo, '确认密码不一致！');
                 bool = false;
             }

             

             return bool;
         }
         function isCheck(cell, reg) {
             var pattern = /^[0-9A-Za-z]{4,16}$/;
             switch (reg) {
             case '1':
                 pattern = /^[0-9A-Za-z]{4,16}$/;
                 break;
             case '2':
                 pattern = /^(?:\w+\.?)*\w+@(?:\w+\.?)*\w+$/;
                 break;
             case '3':
                 pattern = /^[0-9A-Za-z]{6,12}$/;
                 break;
             }
             if (pattern.test(cell)) {
                 return true;
             }
             return false;
         }
         <%=Message %>
     </script>
    </form>
</body>
</html>
